package com.yunduansing.core.utils;

public class ResultUtil {
	private boolean flag;
	private String msg;
	private Object data;
	
	private ResultUtil(boolean f,String m,Object o){
		flag=f;
		msg=m;
		data=o;
	}
	
	public static ResultUtil init(){
		return new ResultUtil(true,null,null);
	}
	
	public static ResultUtil init(boolean b){
		return new ResultUtil(b,null,null);
	}
	
	public static ResultUtil init(boolean b,String m){
		return new ResultUtil(b,m,null);
	}
	
	public static ResultUtil init(boolean b,String m,Object o){
		return new ResultUtil(b,m,o);
	}
	
	public static ResultUtil init(Exception e){
		return new ResultUtil(false,e.getMessage(),null);
	}

	public boolean isFlag() {
		return flag;
	}

	public void setFlag(boolean flag) {
		this.flag = flag;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}
}
